<html>
<head><meta charset="utf-8"><title>-fasynchronous-unwind-tables · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html">-fasynchronous-unwind-tables</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="151043845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151043845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151043845">(Dec 06 2018 at 21:09)</a>:</h4>
<p>Anyone know anything about <code>-fasynchronous-unwind-tables</code>? Do we expose this option in compiling rustc? In particular, i'm trying to use perf but none of the <code>--call-graph</code> options seem to be giving me the data I want (even with frame pointers enabled). <span class="user-mention" data-user-id="116015">@Alex Crichton</span> tells me that maybe I need to enable "asyncronous unwind tables" since sampling can occur at any point in time, and our dwarf data may not be prepared for that.</p>



<a name="151043852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151043852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151043852">(Dec 06 2018 at 21:09)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> seems like something you might know :)</p>



<a name="151046275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151046275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151046275">(Dec 06 2018 at 21:46)</a>:</h4>
<p>I don’t know about asynchronous unwind tables, but it also seems weird to me that you would need it, unless you are profiling unwinding...</p>



<a name="151050721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151050721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151050721">(Dec 06 2018 at 23:04)</a>:</h4>
<p>Looks like it's just the <code>uwtable</code> attribute in LLVM, set here in rustc -- <a href="https://github.com/rust-lang/rust/blob/118e052d84157a675649fe640e3d56f264475a3a/src/librustc_codegen_llvm/attributes.rs#L162-L181" target="_blank" title="https://github.com/rust-lang/rust/blob/118e052d84157a675649fe640e3d56f264475a3a/src/librustc_codegen_llvm/attributes.rs#L162-L181">https://github.com/rust-lang/rust/blob/118e052d84157a675649fe640e3d56f264475a3a/src/librustc_codegen_llvm/attributes.rs#L162-L181</a></p>



<a name="151050726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151050726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151050726">(Dec 06 2018 at 23:05)</a>:</h4>
<p>some targets have it on by default like windows, but there's currently no CLI flag to turn it on by default</p>



<a name="151050734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151050734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151050734">(Dec 06 2018 at 23:05)</a>:</h4>
<p>I think <span class="user-mention" data-user-id="116009">@nikomatsakis</span> for better debuginfo we'd need to add a CLI flag to turn it on by default for the compilation at hand</p>



<a name="151099222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151099222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151099222">(Dec 07 2018 at 09:36)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> hmm but that code says:</p>
<div class="codehilite"><pre><span></span><span class="k">if</span><span class="w"> </span><span class="o">!</span><span class="n">cx</span><span class="p">.</span><span class="n">sess</span><span class="p">().</span><span class="n">no_landing_pads</span><span class="p">()</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="n">cx</span><span class="p">.</span><span class="n">sess</span><span class="p">().</span><span class="n">target</span><span class="p">.</span><span class="n">target</span><span class="p">.</span><span class="n">options</span><span class="p">.</span><span class="n">requires_uwtable</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">..</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>


<p>I presume <code>no_landing_pads</code> means <code>-Cpanic=abort</code>? In that case, aren't we enabling this attribute for the compiler anyway, since we don't build with that option?</p>



<a name="151103325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151103325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151103325">(Dec 07 2018 at 10:59)</a>:</h4>
<p>You can make yourself a custom target that derives the primary target and sets "requires_uwtable"?</p>



<a name="151103383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151103383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151103383">(Dec 07 2018 at 11:00)</a>:</h4>
<p>if <code>no_landing_pads</code> are specified, the attribute is not added because it has no value whatsoever then</p>



<a name="151103391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151103391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151103391">(Dec 07 2018 at 11:00)</a>:</h4>
<p>(given that there are no unwind targets)</p>



<a name="151104687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151104687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151104687">(Dec 07 2018 at 11:27)</a>:</h4>
<p>well, that's not clear</p>



<a name="151104700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151104700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151104700">(Dec 07 2018 at 11:27)</a>:</h4>
<p>in particular, for profiling, we may need to walk the stack back at arbitrary spots</p>



<a name="151104705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151104705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151104705">(Dec 07 2018 at 11:27)</a>:</h4>
<p>and I gather that this attribute is relevant then (at least <span class="user-mention" data-user-id="116015">@Alex Crichton</span> thought so)</p>



<a name="151104709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151104709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151104709">(Dec 07 2018 at 11:27)</a>:</h4>
<p>so we may want a way to force it on <em>even if</em> there is no unwinding</p>



<a name="151110673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables/near/151110673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/-fasynchronous-unwind-tables.html#151110673">(Dec 07 2018 at 13:22)</a>:</h4>
<p>Conclusion was that LLVM/Clang don't actually implement asynchronous-unwind-tables, unlike gcc</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>